//
//  IMMoreFunctionCell.m
//  WeiYiMei
//
//  Created by 李叶夫 on 2019/7/6.
//  Copyright © 2019年 liyefu. All rights reserved.
//

#import "IMMoreFunctionCell.h"

@interface IMMoreFunctionCell ()

@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *titleLab;

@end

@implementation IMMoreFunctionCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        [self setupSubViews];
    }
    return self;
}

- (void)setupSubViews
{
    self.imageView = [[UIImageView alloc] init];
    self.imageView.contentMode = UIViewContentModeCenter;
    self.imageView.backgroundColor = [UIColor whiteColor];
    self.imageView.layer.borderColor = kColorDDD.CGColor;
    self.imageView.layer.borderWidth = 1;
    self.imageView.layer.cornerRadius = 5;
    self.imageView.layer.masksToBounds = YES;
    [self addSubview:self.imageView];
    
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.textColor = kColor999999;
    self.titleLab.font = [UIFont systemFontOfSize:15];
    self.titleLab.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.titleLab];
}

- (void)setSource:(NSDictionary *)source
{
    _source = source;
    self.imageView.image = [UIImage imageNamed:source[@"img"]];
    self.titleLab.text = source[@"title"];
}

- (void)layoutSubviews
{
    self.imageView.frame = CGRectMake(5, 0, self.bounds.size.width-10, self.bounds.size.width-10);
    self.titleLab.frame = CGRectMake(0, self.bounds.size.height - 20, self.bounds.size.width, 20);
}

@end
